<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
    <title>Package signup Form a Responsive Widget Template :: w3layouts</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/bootstrap.min.css">
    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="${pageContext.request.contextPath}/static/jquery.min.js"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="${pageContext.request.contextPath}/static/bootstrap.min.js"></script>
</head>
<body>
<br>
<c:if test="${isUpdate == null}">
<form class="form-horizontal" style="width:80%;" action="/category/add" method="post">
    <div class="form-group">
        <label for="inputEmail3" class="col-sm-2 control-label">分类标题</label>
        <div class="col-sm-10">
            <input required type="text" name="title" class="form-control" id="inputEmail3" placeholder="分类标题">
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-default" style="width: 100px">添加</button>
        </div>
    </div>
</form>
</c:if>

<c:if test="${isUpdate != null}">
    <form class="form-horizontal" style="width:80%;" action="/category/updateById" method="post">
        <div class="form-group">
            <label for="inputEmail3" class="col-sm-2 control-label">分类标题</label>
            <div class="col-sm-10">
                <input required type="text" name="title" value="${category.title}" class="form-control" id="inputEmail4" >
                <input type="hidden" name="categoryId" value="${category.categoryId}">
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-default" style="width: 100px">修改</button>
            </div>
        </div>
    </form>
</c:if>
<br>

</body>
</html>